home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 501 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.5 KB  |  45 lines

  1. Path: chronicle.mti.sgi.com!austern
  2. From: boukanov@kvark.fi.uib.no (Igor Boukanov)
  3. Newsgroups: comp.std.c++
  4. Subject: ? about friend template
  5. Date: 15 Feb 1996 09:19:51 PST
  6. Organization: Fysisk institutt, Universitetet i Bergen
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4fvj7u$ku0@ugress.uib.no>
  9. NNTP-Posting-Host: isolde.mti.sgi.com
  10. Summary: How have one to declare friend templates
  11. Keywords: c++, template
  12. X-Original-Date: 15 Feb 1996 15:24:46 GMT
  13. X-Newsreader: TIN [version 1.2 PL2]
  14. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  15.     iQBVAwUBMSNrUky4NqrwXLNJAQGepAIAzNyp4ovFWU7BPGK62JkKBRtHDorhLJ6v
  16.     uHuhgFv8O+ATPebo3HJxRyHQe90cOFfW85q56jQGVsMOYf8PrVtxPw==
  17.     =sWz+
  18. Originator: austern@isolde.mti.sgi.com
  19.  
  20.    How have I to declare according to the standard template class to be 
  21. a friend of non template class? I suppose it should be done in the next way:
  22.  
  23. template<class T> class template_class{
  24.    ...
  25. };
  26.  
  27. class simple_class{
  28.    friend template<class T> class template_class;
  29.    // or template<class T> friend class template_class ?;
  30.    ...
  31. };
  32.  
  33.    The question is appeared because g++ and DEC C++ for OSF generate 
  34. errors in such lines. 
  35.  
  36. P.S.
  37.    This is modified version of my message posted to comp.lang.c++.
  38.  
  39. --
  40. With best regards, Igor Boukanov (igor.boukanov@fi.uib.no).
  41. ---
  42. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  43.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  44.   in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
  45.